Focusing on the problem that user privileges cannot dynamically change with time in the current access control and the security problems in the access control contract, an access control model based on Role-Based Access Control (RBAC) model, blockchain and user credit was proposed. Firstly, the roles were distributed to relevant users by the role publishing organization, and the access control strategy was stored in the blockchain through smart contract method. In the contract, the access credit threshold was set, and the contract information was verifiable, traceable and tamper-proof to any service provider organization in the system. Secondly, the final credit was evaluated by the model according to current credit, historical credit and recommended credit of the user, and the access privileges of the corresponding role was obtained based on the final credit. Finally, when the user credit reached the credit threshold set in the contract, the user can access the corresponding service organization. Experimental results show that the proposed model has certain fine granularity, dynamicity and security in the security access control.